import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import locale from 'element-plus/lib/locale/lang/zh-cn';
import App from '@/App.vue';
import router from '@/router';
import store from '@/store';
import { installDirectives } from '@/directive/permission/index.js';
import globalProperties from '@/utils/globalProperties.js';
import globalComponents from '@/utils/globalComponents.js';
import jiayouIcon from '@/components/iconSvg/jiayouIcon.vue';
import './permission.js';

import 'virtual:svg-icons-register';

import '@/assets/styles/tailwindcss.css'; // 不能放在element-plus之后，放在之后会覆盖element-plus的样式
import 'element-plus/dist/index.css';
import '@/assets/styles/animate.css'; // 动画库样式

const app = createApp(App);

// 全局注册组件
app.use(ElementPlus, { locale });
app.component('JiayouIcon', jiayouIcon);
// 全局指令
installDirectives(app);

app.use(router).use(store).use(globalProperties).use(globalComponents).mount('#app');
